package com.realtime;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

public class PropertiesLoadingApp {

	public static void main(String[] args) {
		
		Properties prop=new Properties();
		InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("abc.properties");

		try
		{
			prop.load(inputStream);
		}
		catch (IOException e) {
			e.printStackTrace();
		}
		//System.out.println(prop.get("user"));//o/p null
		 		
		System.out.println(prop);
		/**
		Properties prop=new Properties();
		
		URL url=ClassLoader.getSystemResource("abc.properties");
		
		try{
		prop.load(url.openStream());
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		System.out.println(prop);
		*/
	}

}

